import request from '../utils/request.js'

// 用户登录
export const login = (data) => {
	return request({
		url: '/login',
		method: 'post',
		data: data
	})
}

// 用户注册
export const register = (data) => {
	return request({
		url: '/register',
		method: 'post',
		data: data
	})
}

// 根据token获取用户信息
export const getUserInfo = () => {
	return request({
		url: '/getNowUserInfo',
		method: 'get',
	})
}

// 获取短信验证码
export const getPhoneCode = (phone) => {
	return request({
		url: `/getPhoneCode?phone=${phone}`,
		method: 'get'
	})
}